#!/bin/bash
# 安装ROS
echo "chooses:" > fish_install.yaml
echo "- {choose: 1, desc: '一键安装:ROS(支持ROS和ROS2,树莓派Jetson)'}" >> fish_install.yaml
echo "- {choose: 1, desc: 更换源继续安装}" >> fish_install.yaml
echo "- {choose: 2, desc: 清理三方源}" >> fish_install.yaml
echo "- {choose: 1, desc: Recommends Version}" >> fish_install.yaml
echo "- {choose: 1, desc: 桌面版}" >> fish_install.yaml
wget http://fishros.com/install  -O fishros && /bin/bash fishros
apt install -y --no-install-recommends python3-pip git
# 安装rosdep
echo "chooses:" > fish_install.yaml
echo "- {choose: 3, desc: '一键安装:rosdep'}" >> fish_install.yaml
wget http://fishros.com/install  -O fishros && /bin/bash fishros
echo "source /opt/ros/*/setup.bash" > /etc/bash.bashrc
source /opt/ros/*/setup.bash
rosdepc init
rosdepc update
# pip换源
mkdir ~/.pip
echo -e "[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple\n[install]\ntrusted-host = pypi.tuna.tsinghua.edu.cn" | sudo tee ~/.pip/pip.conf
# Clean up
rm -rf /var/lib/apt/lists/*  /tmp/* /var/tmp/*
apt-get clean && apt autoclean